export class ColorUtil {

    public static getRandomColor(colors?: string[]): string {
        if (colors?.length) {
            return colors[Math.floor(Math.random() * colors.length)];
        }
        const baseWord = '0123456789ABCDEF';
        let result = '#';
        for (let i = 0; i < 6; i++) {
            result += baseWord[Math.floor(Math.random() * 16)]; // [0, 16)
        }
        return result;
    }

    public static getRandom() {
        return Math.random().toString(36).substring(2);
    }

    constructor() {

    }
}
